using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class KillTrigger : MonoBehaviour {
	
	private List <GameObject> spawnList;
	
	void Start ()
	{
		spawnList = new List<GameObject>();
	}
	
	void OnTriggerEnter (Collider other)
	{
		if(other.gameObject.tag == "Kill" || other.gameObject.tag == "Ramp")
		{
			RemoveFromList(other.gameObject);
			Destroy(other.gameObject);
		}
	}
	
	public void AddToList (GameObject obj)
	{
		spawnList.Add(obj);
	}
	
	private void RemoveFromList (GameObject obj)
	{
		spawnList.Remove(obj);
	}
}
